<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
    <%@taglib uri="/struts-tags" prefix="s" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>
<script type="text/javascript" src = "./scripts/jquery.js"></script>
<script type="text/javascript" src = "./scripts/jquery-ui.js"></script>
</head>
<body>
EDIT FORM


<s:form action="editmain.action">

<s:textfield name="contact.firstName" label="Firstname" required="true"/>
<s:textfield name="contact.lastName" label="Lastname" required="true"/>
<s:textfield name="contact.emailId" label="Email" />
<s:textfield name="contact.cellNo" label="Cell No." />
<s:textfield name="contact.website" label="Homepage" />
<s:textfield name="contact.birthDate" label="Birthdate" />
<s:select label="Contact Type *" list="contactList"
listKey="contactType" listValue="contactType"
name="chooseContactType" headerKey="-1"
headerValue="-- Please Select --" required="true"/>
<s:textfield name="contact.contactManager" label="Manager" id="selected" readonly="true"/> <a href=" #" id="popup">Lookup</a>
<input type="checkbox" name="checkbox" id="checkbox" onclick="check()"> Is Active?
<s:hidden name="contact.isActive" id="isactive"/>
<s:hidden name="isActive" id="isActive"/>
<s:hidden name="contact.id"/>
<s:submit value="Edit Contact" align="center"/>
</s:form>
<input type="button" value="Back" onclick="backPage()">
<script type="text/javascript">
function backPage(){
	history.back();
}

$(function(){
	 $("#popup").click(function(){
		
		 window.open("index.jsp","_blank","width=400,height=345");
			ev.preventDefault();
	 });
	 
});

function check(){
	if($("#checkbox").is(':checked')){
		$("#isActive").val("YES");}else{
			$("#isActive").val("NO");
		}
	
}
$(document).ready(
		function() {
			if($("#isactive").val()=="YES"){
				//alert($("#isActive").val());
				$('input[name=checkbox]').attr('checked',true);
			}else {
				//alert($("#isActive").val());
				$('input[name=checkbox]').attr('checked',false);
			}
		});
</script>
</body>
</html>